﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using AspNetCs.Common;

public partial class MoreVideos : BasePage
{
    private int pageSize = 20;
    protected int recodCount = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindReapter();
        }
        else
        {
        }
    }


    public string DisplayLinks(int id, string address1, string address2, string address3, string address4, string address5)
    {
        string str = "";
        str = ((address1 == "" ? "" : "<a href='#' onclick='window.open(\"" + configInfo.InstallDir + "PlayVideo_" + id + "_1.aspx\");'>[1]<a>") + (address2 == "" ? "" : "<a href='#' onclick='window.open(\"" + configInfo.InstallDir + "PlayVideo_" + id + "_2.aspx\");'>[2]<a>") + (address3 == "" ? "" : "<a href='#' onclick='window.open(\"" + configInfo.InstallDir + "PlayVideo_" + id + "_3.aspx\");'>[3]<a>") + (address4 == "" ? "" : "<a href='#' onclick='window.open(\"" + configInfo.InstallDir + "PlayVideo_" + id + "_4.aspx\");'>[4]<a>") + (address5 == "" ? "" : "<a href='#' onclick='window.open(\"" + configInfo.InstallDir + "PlayVideo_" + id + "_5.aspx\");'>[5]<a>"));
        return str;

    }

    public void BindReapter()
    {
        string cmdText = "select *from video order by id desc";
        DataPagesOperate operate = new DataPagesOperate();
        AspNetPager1.PageSize = pageSize;
        operate.BindRepeater(cmdText, AspNetPager1, "id desc", "id", rptList, out recodCount);

    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindReapter();
    }
    protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Footer)
        {
            if (rptList.Items.Count <= 0)
            {
                Panel pl = e.Item.FindControl("Pl_Nothing") as Panel;
                pl.Visible = true;
            }
        }
    }
}
